home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / ctutor2 / twoway.c < prev    next >
Text File  |  1985-02-05  |  768b  |  23 lines

  1. main()
  2. {
  3. int pecans,apples;
  4.  
  5.    pecans = 100;
  6.    apples = 101;
  7.    printf("The starting values are %d %d\n",pecans,apples);
  8.  
  9.                            /* when we call "fixup"          */
  10.    fixup(pecans,&apples);  /* we take the value of pecans   */
  11.                            /* we take the address of apples */
  12.  
  13.    printf("The ending values are %d %d\n",pecans,apples);
  14. }
  15.  
  16. fixup(nuts,fruit)             /* nuts is an integer value   */
  17. int nuts,*fruit;              /* fruit points to an integer */
  18. {
  19.    printf("The values are %d %d\n",nuts,*fruit);
  20.    nuts = 135;
  21.    *fruit = 172;
  22.    printf("The values are %d %d\n",nuts,*fruit);
  23. }